package main

import "fmt"

/*
	lesson6:数组
*/

func main() {
	var a [5]int
	fmt.Println("空数组:", a)

	a[4] = 100
	fmt.Println("设值:", a)
	fmt.Println("取值:", a[4])

	fmt.Println("长度:", len(a))

	b := [5]int{1, 2, 3, 4, 5}
	fmt.Println("dcl:", b)

	c := [5]string{"1", "2", "3", "4", "5"}
	fmt.Println("字符串数组:", c)

	var twoD [2][3]int
	for i := 0; i < 2; i++ {
		for j := 0; j < 3; j++ {
			twoD[i][j] = i + j
		}
	}
	fmt.Println("2d:", twoD)
}
